import request from '@/api/request'

//品鉴卡
export function getWxCards(params) {
  return request({
    url: '/cards/wx_card/',
    method: 'GET',
    params
  })
}

export function getWxCardById(card_id) {
  return request({
    url: `/cards/wx_card/${card_id}/`,
    method: 'GET',
  })
}

export function addWxCard(data) {
  return request({
    url: '/cards/wx_card/',
    method: 'POST',
    data
  })
}

export function updateWxCard(data) {
  return request({
    url: `/cards/wx_card/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delWxCard(data) {
  return request({
    url: `/cards/wx_card/${data.id}/`,
    method: 'DELETE',
  })
}

export function cardImageUpload(data){
  return request({
    url: '/cards/image_upload/',
    method: 'POST',
    data
  })
}

export function cardImageDel(card_id){
  return request({
    url: `/cards/image_del/${card_id}/`,
    method: 'POST',
  })
}

///商家优惠卡
export function getWxRetailerCards(params) {
  return request({
    url: '/cards/wx_retailer_card/',
    method: 'GET',
    params
  })
}

export function getWxRetailerCardById(card_id) {
  return request({
    url: `/cards/wx_retailer_card/${card_id}`,
    method: 'GET',
  })
}



export function discountCardVerify(data){
  return request({
    url: '/cards/discount_card_verify/',
    method: 'POST',
    data
  })
}

// 优惠卡赠送
export function wxRetailerCardGift(data){
  return request({
    url: '/cards/wx_card_gift/',
    method: 'POST',
    data
  })
}

//用户优惠卡
export function getWxUserGiftCards(params) {
  return request({
    url: '/cards/wx_user_card/',
    method: 'GET',
    params
  })
}

export function getWxuserGiftCardById(card_id) {
  return request({
    url: `/cards/wx_user_card/${card_id}/`,
    method: 'GET',
  })
}


// 优惠卡消费
export function wxUserCardConsume(data){
  return request({
    url: '/cards/wx_card_consume/',
    method: 'POST',
    data
  })
}

export function wxUserCardConsumeList(params){
  return request({
    url: '/cards/wx_card_consume_list/',
    method: 'GET',
    params
  })
}

export function wxUserCardConsumeById(card_id){
  return request({
    url: `/cards/wx_card_consume_list/${card_id}/`,
    method: 'GET',
  })
}

export function wxGiftCardList(params){
  return request({
    url: '/cards/wx_gift_card/',
    method: 'GET',
    params
  })
}


export function wxGiftCardById(card_id){
  return request({
    url: `/cards/wx_gift_card/${card_id}/`,
    method: 'GET',
  })
}



// 商家结算账单
export function wxBalanceAccountStats(params){
  return request({
    url: '/cards/wx_balance_account_stats/',
    method: 'GET',
    params
  })
}
//本店结算账单
export function wxMyBalanceAccountStats(params){
  return request({
    url: '/cards/wx_my_balance_account_stats/',
    method: 'GET',
    params
  })
}

// 客户品鉴卡
export function getWxSampleCards(params) {
  return request({
    url: '/cards/wx_sample_card/',
    method: 'GET',
    params
  })
}

// export function getWxSampleCardById(sample_card_id) {
//   return request({
//     url: `/cards/wx_sample_card/${sample_card_id}/`,
//     method: 'GET',
//   })
// }

export function getWxSampleCard(params) {
  return request({
    url: '/cards/wx_sample_card_ex/',
    method: 'GET',
    params
  })
}

export function getWxSampleCardBykey(key) {
  return request({
    url: `/cards/wx_sample_card_detail/${key}/`,
    method: 'GET',
  })
}

export function addWxSampleCard(data) {
  return request({
    url: '/cards/wx_sample_card/',
    method: 'POST',
    data
  })
}

// export function updateWxCard(data) {
//   return request({
//     url: `/cards/wx_card/${data.id}/`,
//     method: 'PUT',
//     data
//   })
// }

export function delWxSampleCard(data) {
  return request({
    url: `/cards/wx_sample_card/${data.id}/`,
    method: 'DELETE',
  })
}

export function getWxClientSampleRecords(params) {
  return request({
    url: '/cards/wx_client_sample_record/',
    method: 'GET',
    params
  })
}

export function getWxClientSampleRecordById(id) {
  return request({
    url: `/cards/wx_client_sample_record/${id}/`,
    method: 'GET',
  })
}

export function wxClientSampleConfirm(data) {
  return request({
    url: '/cards/wx_csample_confirm/',
    method: 'POST',
    data
  })
}

export function wxBalanceBill(data) {
  return request({
    url: '/cards/wx_balance_bill/',
    method: 'POST',
    data
  })
}

export function getWxBalanceBillHis(params) {
  return request({
    url: '/cards/wx_balance_bill_his/',
    method: 'GET',
    params
  })
}

export function getWxBalanceBillStats(params) {
  return request({
    url: '/cards/wx_balance_bill_stats/',
    method: 'GET',
    params
  })
}